package org.openwebtop.sunshine.action.dashboard;

import java.util.List;

import org.openwebtop.sunshine.dao.CodeRepositoryDAO;
import org.openwebtop.sunshine.dao.ReviewProjectDAO;
import org.openwebtop.sunshine.domain.CodeRepository;
import org.openwebtop.sunshine.domain.ReviewProject;

import com.opensymphony.xwork.ActionSupport;

public class DashboardAction {
	private ReviewProjectDAO reviewProjectDAO;
	private CodeRepositoryDAO codeRepositoryDAO;

	// Getter
	private List<ReviewProject> reviewProjects;
	private List<CodeRepository> codeRepositories;

	public String execute() throws Exception {
		reviewProjects = reviewProjectDAO.getReviewProjects();
		codeRepositories = codeRepositoryDAO.getCodeRepositories();

		return ActionSupport.SUCCESS;
	}

	public void setReviewProjectDAO(ReviewProjectDAO reviewProjectDAO) {
		this.reviewProjectDAO = reviewProjectDAO;
	}

	public void setCodeRepositoryDAO(CodeRepositoryDAO codeRepositoryDAO) {
		this.codeRepositoryDAO = codeRepositoryDAO;
	}

	public List<ReviewProject> getReviewProjects() {
		return reviewProjects;
	}

	public List<CodeRepository> getCodeRepositories() {
		return codeRepositories;
	}

}
